package com.tarena.demo.luban.all.main.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.tarena.demo.luban.commons.exception.BusinessDemoException;
import com.tarena.demo.luban.commons.restful.ResponseCode;
import com.tarena.demo.luban.protocol.order.param.OrderAddParam;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AddOrderServiceBlockHandler {

    public static void blockHandler(OrderAddParam param, BlockException e){
      log.info("当前处理的方法正在处理降级逻辑",e);
      throw new BusinessDemoException(ResponseCode.BAD_REQUEST,"新增订单被限流啦！");
    }
}
